﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace Drive.LiveExcelHost.Mvc
{
    class HttpContext
    {
        public static HttpContext Current
        {
            get
            {
                return threadLocal.Value;
            }
            internal set
            {
                threadLocal.Value = value;
            }
        }

        public Request Request { get; }
        public Response Response { get; }

        static ThreadLocal<HttpContext> threadLocal = new ThreadLocal<HttpContext>();

        public HttpContext(Request request)
        {
            this.Request = request;
            this.Response = request.CreateResponse();
        }
    }
}
